<?php

namespace api\energy\factory\facade;


use api\energy\factory\electric\ElectricMeterControl;
use api\energy\factory\electric\ElectricMeterRealtimeRead;
use api\energy\factory\electric\QueryElectricCollectorDetail;
use api\energy\factory\electric\QueryElectricCollectorList;
use api\energy\factory\electric\QueryElectricMeterDayFreeze;
use api\energy\factory\electric\QueryElectricMeterDetail;
use api\energy\factory\electric\QueryElectricMeterList;

class Electric
{

    /**
     * 查询电表列表
     *
     * @param int|null $page 页码
     * @param int|null $limit 每页数量
     * @return QueryElectricMeterList
     */
    public static function queryElectricMeterList(int $page = null, int $limit = null): QueryElectricMeterList
    {
        return (new QueryElectricMeterList($page, $limit));
    }

    /**
     * 查询电表详情
     *
     * @param string $address 电表地址
     * @return QueryElectricMeterDetail
     */
    public static function queryElectricMeterDetail(string $address = ''): QueryElectricMeterDetail
    {
        return (new QueryElectricMeterDetail($address));
    }

    /**
     * 电表实时抄表
     *
     * @param string $address 电表地址
     * @param int|null $type 抄表类型 1正向有功
     * @return ElectricMeterRealtimeRead
     */
    public static function electricMeterRealtimeRead(string $address = '', int $type = null): ElectricMeterRealtimeRead
    {
        return (new ElectricMeterRealtimeRead($address, $type));
    }

    /**
     * 电表控制
     *
     * @param string $address 电表地址
     * @param int|null $type 操作类型 1: 查询状态 2: 断电 3: 送电 4: 允许合闸
     * @return ElectricMeterControl
     */
    public static function electricMeterControl(string $address = '', int $type = null): ElectricMeterControl
    {
        return (new ElectricMeterControl($address, $type));
    }

    /**
     * 查询电表日冻结
     *
     * @param string $startTime 开始日期
     * @param string $endTime 结束日期
     * @return QueryElectricMeterDayFreeze
     */
    public static function queryElectricMeterDayFreeze(string $startTime, string $endTime): QueryElectricMeterDayFreeze
    {
        return (new QueryElectricMeterDayFreeze($startTime, $endTime));
    }

    /**
     * 查询电表采集器列表
     *
     * @param int|null $page 页码
     * @param int|null $limit 每页数量
     * @return QueryElectricCollectorList
     */
    public static function queryElectricCollectorList(int $page = null, int $limit = null): QueryElectricCollectorList
    {
        return (new QueryElectricCollectorList($page, $limit));
    }

    /**
     * 查询电表采集器详情
     *
     * @param string $address 采集器编号
     * @return QueryElectricCollectorDetail
     */
    public static function queryElectricCollectorDetail(string $address = ''): QueryElectricCollectorDetail
    {
        return (new QueryElectricCollectorDetail($address));
    }


}